<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    
<% request.setCharacterEncoding("utf-8"); %>
<!DOCTYPE >
<html>
<!-- 个人情况中的花积分界面  -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/page.css" />
<link rel="stylesheet" href="../../css/other.css" />
<link rel="stylesheet" href="../../css/home.css" />
<script src="../../js/jquery.min.js"></script>

<script src="../../js/page.js"></script>
<title>智行校园-精准化服务平台</title>
<style>
    div.the_container  div.points_div img{
      width:4.5em;
      height:4.5em;
    }
    div.the_container div.points_div p{
      background:#f8f8f8;
      width:calc(100% - 10em);
      margin-left: 1em;
      margin-top: 0.3em;
      padding: 0.3em 0.3em 0.3em 0;
       min-height: 2em;
    }
    div.the_container div.points_div h4{
        font-weight:normal;
         width:calc(100% - 7em);
         padding:0.3em 1em
    }
    div.the_container div.points_div h4 label{
        float:right;
        font-weight:normal;
    }
    div.the_rcontainer div.points_div {
        padding: 0.5em 0;
}
.color_black{
       color:black;
   }
</style>
</head>
<body >
<input id="the_value" value="消息" style="display:none"/>
 <input type="hidden" value="" name="userid" />
<div class="the_container">
	<div class="the_lcontainer col-2" style="height:auto"></div>
	<div class="the_rcontainer" style="min-height:32em">
	   <h3></h3>
	   <div class="tcdPageCode"></div>
	</div>
</div>
<script>
     var page_count=5;
     var page=1;
     var user_id = '<%=session.getAttribute("userid")%>';
     var user_name = '<%=session.getAttribute("username")%>';
     var ticket = '<%=session.getAttribute("ticket")%>';
     $('input[name=userid]').attr('value',user_id);
     var m_type='<%=request.getParameter("m_type")%>';
     var type_name='<a class="color_black" href="../../html/personal_center/message.jsp">'+"消息&nbsp>>&nbsp"+'</a>'+'<a class="color_black">'+'<%=request.getParameter("type_name")%>'+'</a>';
     $('.the_rcontainer h3:eq(0)').append(type_name);
 </script>
 <script src="../../js/header.js"></script>
<script src="../../js/leftcol.js"></script>
 <script>
     $.getJSON("/WDDXSERVER/message/getMessageFunctionDetail",{userid:user_id,function_id:m_type,pagenum:page,pageSize:page_count,ticket:ticket},function(data){
         data = data.content.message;
         if(data.total>page_count){
    		   var the_count=Math.ceil(parseInt(data.total)/page_count);
    		   $(".tcdPageCode").createPage({
    		         pageCount:the_count,
    		         current:1,
    		         backFn:function(p){
    		        	 $.getJSON("getMessageFunctionDetail",{userid:user_id,function_id:m_type,pagenum:p,pageSize:page_count,ticket:ticket},function(data){
    		        		 $('div.the_rcontainer').find('div.points_div').remove();
    		        	      paint_message(data.rows);
    		        	 });
    		         }
    		     });
    		   paint_message(data.rows);
    	   } 
    	 paint_message(data.rows);   
     });
     function paint_message(data){
    	 $('div.the_rcontainer div.points_div').remove();
    	 var str='';
    	 for(var i=0;i<data.length;i++){
    	  str+='<a target="_blank " href="'+data[i].n_url+'" class="color_black"><div class="points_div"><img src="http://app.cqut.edu.cn/content/image/tscx.png">'+
	      '<h4>'+data[i].n_title+'<label>'+data[i].n_send_time+'</label></h4><br/>'+
	      '<p>'+data[i].n_message+'</p></div></a>';
	      }
    	 $('div.tcdPageCode').before(str);
     }
</script>
</body>
</html>